{"objectClass":"NSDictionary","root":{"objectClass":"MindNode","ID":"16F6F","rootPoint":{"objectClass":"CGPoint","x":360,"y":2182},"lineColorHex":"#BBBBBB","children":{"0":{"objectClass":"MindNode","ID":"RRXU6","lineColorHex":"#BF58F5","children":{"0":{"objectClass":"MindNode","ID":"4QUR2","lineColorHex":"#DC306C","children":{"0":{"objectClass":"MindNode","ID":"6RDL8","lineColorHex":"#DC306C","text":"处理器管理"},"1":{"objectClass":"MindNode","ID":"6128X","lineColorHex":"#DC306C","text":"存储器管理"},"2":{"objectClass":"MindNode","ID":"IW8N1","lineColorHex":"#DC306C","text":"文件管理"},"3":{"objectClass":"MindNode","ID":"NME67","lineColorHex":"#DC306C","text":"设备管理"},"objectClass":"NSArray"},"text":"资源的管理者"},"1":{"objectClass":"MindNode","ID":"7U5VL","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XT8WG","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"31F4Y","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3RWD2","lineColorHex":"#26BBFF","text":"交互式如cmd"},"objectClass":"NSArray"},"text":"联机命令接口"},"1":{"objectClass":"MindNode","ID":"TA17Z","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"R3R5J","lineColorHex":"#26BBFF","text":"批处理如脚本"},"objectClass":"NSArray"},"text":"脱机命令接口"},"objectClass":"NSArray"},"text":"命令接口"},"1":{"objectClass":"MindNode","ID":"ZD896","lineColorHex":"#26BBFF","text":"程序接口（用户通过程序间接调用）"},"2":{"objectClass":"MindNode","ID":"3L467","lineColorHex":"#26BBFF","text":"GUI"},"objectClass":"NSArray"},"text":"向用户提供服务","shrink":true},"2":{"objectClass":"MindNode","ID":"JAESW","lineColorHex":"#37C45A","text":"对硬件及其的扩展"},"3":{"objectClass":"MindNode","ID":"7U74T","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"PT115","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"74059","lineColorHex":"#1BD6E7","text":"宏观同时，微观交替"},"1":{"objectClass":"MindNode","ID":"I176V","lineColorHex":"#1BD6E7","text":"并行：宏观同时，微观同时","markType":7},"objectClass":"NSArray"},"text":"并发","summarizedNodeID":"91I0R","summarizedText":"并发+共享    互为存在条件"},"1":{"objectClass":"MindNode","ID":"91I0R","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"N6TCK","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"L9X45","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"4KW9U","lineColorHex":"#1BD6E7","text":"ex：摄像头不能同时qq，微信"},"objectClass":"NSArray"},"text":"一些资源可以给多进程使用，但一个时间段只允许一个进程访问该资源"},"objectClass":"NSArray"},"text":"互斥共享"},"1":{"objectClass":"MindNode","ID":"ITN02","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"196BE","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"463K0","lineColorHex":"#1BD6E7","text":"ex：userA微信，qq同时给userB发文件"},"objectClass":"NSArray"},"text":"一些资源某一时间段由多个进程“同时”对它们进行访问"},"objectClass":"NSArray"},"text":"同时共享"},"objectClass":"NSArray"},"text":"共享"},"2":{"objectClass":"MindNode","ID":"57KAT","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"0C465","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"28688","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"U3S8L","lineColorHex":"#1BD6E7","text":"ex：gta+cs 内存 > 实际的4g"},"objectClass":"NSArray"},"text":"空分复用技术"},"1":{"objectClass":"MindNode","ID":"S82Q5","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"5721X","lineColorHex":"#1BD6E7","text":"ex：单核cpu打开多app"},"objectClass":"NSArray"},"text":"时分复用技术"},"objectClass":"NSArray"},"text":"一个物理上的实体变为逻辑上的对应物，物理实体是实际存在的，逻辑上的对应物是用户感受到的"},"objectClass":"NSArray"},"text":"虚拟"},"3":{"objectClass":"MindNode","ID":"3T2XR","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"CH312","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"PE8Y0","lineColorHex":"#1BD6E7","text":""},"objectClass":"NSArray"},"text":"在多道程序环境中，允许多个程序并发执行，但由于资源有限，进程的执行不是一贯到底的，而是走走停停，以不可预知的速度向前推进"},"objectClass":"NSArray"},"text":"异步"},"objectClass":"NSArray"},"text":"特征","shrink":true},"4":{"objectClass":"MindNode","ID":"38MJY","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"730FF","lineColorHex":"#FFC700","text":"手工操作阶段"},"1":{"objectClass":"MindNode","ID":"Y06MK","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"B8G8N","lineColorHex":"#FFC700","text":"单道批处理系统"},"1":{"objectClass":"MindNode","ID":"F1W6T","lineColorHex":"#FFC700","text":"多道批处理系统"},"objectClass":"NSArray"},"text":"批处理阶段"},"2":{"objectClass":"MindNode","ID":"NZ078","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"Y81UY","lineColorHex":"#FFC700","text":"时间片"},"objectClass":"NSArray"},"text":"分时操作系统"},"3":{"objectClass":"MindNode","ID":"674DA","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"2K5EF","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"FF491","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"X5116","lineColorHex":"#FFC700","text":"ex: 道道发射，自动驾驶"},"objectClass":"NSArray"},"text":"必须在严格的规定时间内完成处理"},"objectClass":"NSArray"},"text":"硬实时系统"},"1":{"objectClass":"MindNode","ID":"HMVMT","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"34M8C","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"6TLV1","lineColorHex":"#FFC700","text":"ex：火车订票系统"},"objectClass":"NSArray"},"text":"能偶尔违法时间规定"},"objectClass":"NSArray"},"text":"软实时系统"},"objectClass":"NSArray"},"text":"实时操作系统"},"4":{"objectClass":"MindNode","ID":"2QE68","lineColorHex":"#FFC700","text":"网络操作系统"},"5":{"objectClass":"MindNode","ID":"PTE7W","lineColorHex":"#FFC700","text":"分布式操作系统"},"6":{"objectClass":"MindNode","ID":"QVYHY","lineColorHex":"#FFC700","text":"个人计算机操作系统"},"objectClass":"NSArray"},"text":"os的发展与分类","shrink":true},"5":{"objectClass":"MindNode","ID":"56PRB","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"245RJ","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"P4VXC","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"4U351","lineColorHex":"#836FFF","text":"特权指令"},"1":{"objectClass":"MindNode","ID":"5415Q","lineColorHex":"#836FFF","text":"非特权指令"},"objectClass":"NSArray"},"text":"指令"},"1":{"objectClass":"MindNode","ID":"7X40K","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"SE047","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"2MXV2","lineColorHex":"#836FFF","text":"非特权+特权指令"},"objectClass":"NSArray"},"text":"核心态"},"1":{"objectClass":"MindNode","ID":"MS66G","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"V1S4E","lineColorHex":"#836FFF","text":"只能非特权指令"},"objectClass":"NSArray"},"text":"用户态"},"objectClass":"NSArray"},"text":"状态"},"2":{"objectClass":"MindNode","ID":"83R21","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"KU6Z7","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"J48Y3","lineColorHex":"#836FFF","text":"系统的管理者，既可以执行特权指令，也可以执行非特权指令，运行在核心态"},"objectClass":"NSArray"},"text":"内核程序"},"1":{"objectClass":"MindNode","ID":"4LM99","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"578F5","lineColorHex":"#836FFF","text":"为保证系统能安全运行，普通应用程序只能执行非特权指令，运行在用户态"},"objectClass":"NSArray"},"text":"应用程序"},"objectClass":"NSArray"},"text":"程序"},"objectClass":"NSArray"},"text":"运行机制"},"1":{"objectClass":"MindNode","ID":"M740B","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"8YG4C","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"YCH5M","lineColorHex":"#836FFF","text":"计时功能"},"objectClass":"NSArray"},"text":"时钟管理"},"1":{"objectClass":"MindNode","ID":"5C1WY","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"VT4BP","lineColorHex":"#836FFF","text":"负责实现中断机制"},"objectClass":"NSArray"},"text":"中断处理"},"2":{"objectClass":"MindNode","ID":"7L92W","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"KI7NQ","lineColorHex":"#836FFF","text":"特殊的程序"},"1":{"objectClass":"MindNode","ID":"P435Q","lineColorHex":"#836FFF","text":"处于操作系统最底层，最接近硬件"},"2":{"objectClass":"MindNode","ID":"932H7","lineColorHex":"#836FFF","text":"具有原子性，运行一气呵成，不可中断"},"3":{"objectClass":"MindNode","ID":"N8QT5","lineColorHex":"#836FFF","text":"运行时间较短，调用频繁"},"objectClass":"NSArray"},"text":"原语"},"3":{"objectClass":"MindNode","ID":"S9R7E","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"5S64S","lineColorHex":"#836FFF","text":"进程管理"},"1":{"objectClass":"MindNode","ID":"Y7I1Y","lineColorHex":"#836FFF","text":"存储器管理"},"2":{"objectClass":"MindNode","ID":"NH6D5","lineColorHex":"#836FFF","text":"设备管理"},"objectClass":"NSArray"},"text":"对系统资源管理的功能"},"objectClass":"NSArray"},"text":"操作系统内核"},"2":{"objectClass":"MindNode","ID":"25SN8","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"2C7KV","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"26WJM","lineColorHex":"#836FFF","text":"将操作系统的主要功能作为系统内核，运行在核心态"},"1":{"objectClass":"MindNode","ID":"56R5N","lineColorHex":"#836FFF","text":"优点：高性能"},"2":{"objectClass":"MindNode","ID":"6874E","lineColorHex":"#836FFF","text":"缺点：内核代码庞大，结构混乱难维护"},"objectClass":"NSArray"},"text":"大内核"},"1":{"objectClass":"MindNode","ID":"PET75","lineColorHex":"#836FFF","children":{"0":{"objectClass":"MindNode","ID":"0378G","lineColorHex":"#836FFF","text":"只把最基本的功能保留在内核"},"1":{"objectClass":"MindNode","ID":"4A3HM","lineColorHex":"#836FFF","text":"优点：内核功能少，结构清晰，方便维护"},"2":{"objectClass":"MindNode","ID":"4WTJD","lineColorHex":"#836FFF","text":"缺点：需要频繁地在核心态和用户态之间切换，性能低"},"objectClass":"NSArray"},"text":"微内核"},"objectClass":"NSArray"},"text":"体系结构"},"objectClass":"NSArray"},"text":"os的运行机制和体系结构","shrink":true},"6":{"objectClass":"MindNode","ID":"GHHMK","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"RSZVK","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"2K542","lineColorHex":"#B3EE3A","text":"对多道程序的并发执行"},"objectClass":"NSArray"},"text":"中断机制的诞生"},"1":{"objectClass":"MindNode","ID":"0PFK6","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"FKI5I","lineColorHex":"#B3EE3A","text":"使cpu从用户态转为核心态"},"objectClass":"NSArray"},"text":"中断的概念和作用"},"2":{"objectClass":"MindNode","ID":"CHEK8","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"G8K65","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"Y3LE4","lineColorHex":"#B3EE3A","text":"自愿中断"},"1":{"objectClass":"MindNode","ID":"8CG65","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"IG7HT","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"35ZVX","lineColorHex":"#B3EE3A","text":"ex：缺页"},"objectClass":"NSArray"},"text":"硬件故障"},"1":{"objectClass":"MindNode","ID":"12N3B","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"O11R5","lineColorHex":"#B3EE3A","text":"ex：整数除0"},"objectClass":"NSArray"},"text":"软件中断"},"objectClass":"NSArray"},"text":"强迫中断"},"objectClass":"NSArray"},"text":"内中断（异常）--来自cpu内部"},"1":{"objectClass":"MindNode","ID":"7BQ9T","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"4SQK9","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"5467Q","lineColorHex":"#B3EE3A","text":"ex：I/O操作完成后的中断信号"},"objectClass":"NSArray"},"text":"外设请求"},"1":{"objectClass":"MindNode","ID":"7RVL1","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"644S8","lineColorHex":"#B3EE3A","text":"二L：用户强行终止一个进程"},"objectClass":"NSArray"},"text":"人工干预"},"objectClass":"NSArray"},"text":"外中断 --来自cpu外部"},"objectClass":"NSArray"},"text":"中断的分类"},"3":{"objectClass":"MindNode","ID":"W517T","lineColorHex":"#B3EE3A","children":{"0":{"objectClass":"MindNode","ID":"859BN","lineColorHex":"#B3EE3A","text":"每条指令执行结束后，cpu检查是否有外部中断信号"},"1":{"objectClass":"MindNode","ID":"W93UH","lineColorHex":"#B3EE3A","text":"若有外部中断信号，则需要保护中断进程的cpu环境"},"2":{"objectClass":"MindNode","ID":"86R54","lineColorHex":"#B3EE3A","text":"根据中断信号类型转入相应的中断处理程序"},"3":{"objectClass":"MindNode","ID":"07TA7","lineColorHex":"#B3EE3A","text":"回复源进程的cpu环境并退出中断，返回源进程继续往下执行"},"objectClass":"NSArray"},"text":"外中断的处理过程"},"objectClass":"NSArray"},"text":"中断和异常","shrink":true},"7":{"objectClass":"MindNode","ID":"1NMHX","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"D42D0","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"CR751","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"MHHOT","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"V2WR7","lineColorHex":"#1BD6E7","text":"完成设备的  请求/释放/启动  等功能"},"objectClass":"NSArray"},"text":"设备管理"},"1":{"objectClass":"MindNode","ID":"11B18","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"23698","lineColorHex":"#1BD6E7","text":"完成文件的  读/写/创建/删除  等功能"},"objectClass":"NSArray"},"text":"文件管理"},"2":{"objectClass":"MindNode","ID":"GJVI8","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"SR9T1","lineColorHex":"#1BD6E7","text":"完成进程的  创建/撤销/阻塞/唤醒  等功能"},"objectClass":"NSArray"},"text":"进程管理"},"3":{"objectClass":"MindNode","ID":"18748","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"9H762","lineColorHex":"#1BD6E7","text":"完成进程间的  消息传递/信号传递   等功能"},"objectClass":"NSArray"},"text":"进程通信"},"4":{"objectClass":"MindNode","ID":"01484","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"68740","lineColorHex":"#1BD6E7","text":"完成内存的   分配/回收  等功能"},"objectClass":"NSArray"},"text":"内存管理"},"objectClass":"NSArray"},"text":"分类"},"1":{"objectClass":"MindNode","ID":"HIU06","lineColorHex":"#1BD6E7","text":"操作系统提供给应用程序使用的接口"},"2":{"objectClass":"MindNode","ID":"65113","lineColorHex":"#1BD6E7","text":"应用程序通过系统调用来请求操作系统的服务"},"3":{"objectClass":"MindNode","ID":"6L142","lineColorHex":"#1BD6E7","text":"使处理器从用户态进入核心态"},"objectClass":"NSArray"},"text":"概念作用"},"1":{"objectClass":"MindNode","ID":"LF11W","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"T6BOC","lineColorHex":"#1BD6E7","text":"系统调用是操作系统向上层提供的接口"},"1":{"objectClass":"MindNode","ID":"2RJRM","lineColorHex":"#1BD6E7","text":"有点函数是对系统调用的进一步封装"},"2":{"objectClass":"MindNode","ID":"VB19L","lineColorHex":"#1BD6E7","text":"当今编写的应用程序大多是通过高级语言提供的库函数间接得进行系统调用"},"objectClass":"NSArray"},"text":"系统调用和库函数的区别"},"2":{"objectClass":"MindNode","ID":"VM447","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"1YLKJ","lineColorHex":"#1BD6E7","text":"1、传递系统调用参数"},"1":{"objectClass":"MindNode","ID":"T4D8B","lineColorHex":"#1BD6E7","text":"2、执行陷入指令"},"2":{"objectClass":"MindNode","ID":"41716","lineColorHex":"#1BD6E7","text":"3、执行系统调用相应服务程序"},"3":{"objectClass":"MindNode","ID":"60Q4R","lineColorHex":"#1BD6E7","text":"4、返回用户程序"},"objectClass":"NSArray"},"text":"系统调用背后的过程"},"objectClass":"NSArray"},"text":"系统调用","shrink":true},"objectClass":"NSArray"},"text":"概述","shrink":true},"1":{"objectClass":"MindNode","ID":"4E5VN","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"0FK16","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"F8F5X","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1D1FB","lineColorHex":"#26BBFF","text":"进程是进程实体的运行过程，是系统进行资源分配和调度的一个独立单位"},"objectClass":"NSArray"},"text":"定义"},"1":{"objectClass":"MindNode","ID":"J5CLP","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"25AWL","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"67U31","lineColorHex":"#26BBFF","text":"进程描述信息"},"1":{"objectClass":"MindNode","ID":"537WO","lineColorHex":"#26BBFF","text":"进程控制和管理信息"},"2":{"objectClass":"MindNode","ID":"G4F48","lineColorHex":"#26BBFF","text":"资源分配清单"},"3":{"objectClass":"MindNode","ID":"A4313","lineColorHex":"#26BBFF","text":"处理及相关信息"},"objectClass":"NSArray"},"text":"PCB"},"1":{"objectClass":"MindNode","ID":"V1KY4","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"IH283","lineColorHex":"#26BBFF","text":"存放要执行的代码"},"objectClass":"NSArray"},"text":"程序段"},"2":{"objectClass":"MindNode","ID":"AD24E","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"WO7R2","lineColorHex":"#26BBFF","text":"存放程序运行过程中处理的数据"},"objectClass":"NSArray"},"text":"数据段"},"objectClass":"NSArray"},"text":"组成"},"2":{"objectClass":"MindNode","ID":"XU868","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"FWCM8","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"23R7H","lineColorHex":"#26BBFF","text":"按照进程状态将pcb分为多个队列"},"1":{"objectClass":"MindNode","ID":"U11TH","lineColorHex":"#26BBFF","text":"操作系统持有各个队列的指针"},"objectClass":"NSArray"},"text":"链接方式"},"1":{"objectClass":"MindNode","ID":"8UX6N","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"BH22I","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"X5J08","lineColorHex":"#26BBFF","text":""},"objectClass":"NSArray"},"text":"根据进程状态的不同，建立几张索引表"},"1":{"objectClass":"MindNode","ID":"JX7DQ","lineColorHex":"#26BBFF","text":"操作系统持有指向各个索引表的指针"},"objectClass":"NSArray"},"text":"索引方式"},"objectClass":"NSArray"},"text":"组织形式"},"3":{"objectClass":"MindNode","ID":"89W57","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3Q43I","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"B180N","lineColorHex":"#26BBFF","text":"进程的最基本特征，进程是程序的一次执行过程，是动态产生、变化和消亡的"},"objectClass":"NSArray"},"text":"动态性"},"1":{"objectClass":"MindNode","ID":"191H2","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"175PJ","lineColorHex":"#26BBFF","text":"内存中有多个进程实体，各进程可并发执行"},"objectClass":"NSArray"},"text":"并发性"},"2":{"objectClass":"MindNode","ID":"S74D9","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XBBGK","lineColorHex":"#26BBFF","text":"进程能独立运行、独立获取资源，各进程可并发执行"},"objectClass":"NSArray"},"text":"独立性"},"3":{"objectClass":"MindNode","ID":"645UY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"R2159","lineColorHex":"#26BBFF","text":"各进程各自独立地、不可预知的速度想起那推进，操作系统要提供“进程同步机制”来解决异步问题"},"objectClass":"NSArray"},"text":"异步性"},"4":{"objectClass":"MindNode","ID":"3W09V","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"D8727","lineColorHex":"#26BBFF","text":"每个进程都会配置一个pcb，结构上来看，进程由程序段、数据段、偏差表组成"},"objectClass":"NSArray"},"text":"结构性"},"objectClass":"NSArray"},"text":"特征"},"objectClass":"NSArray"},"text":"进程概述","shrink":true},"1":{"objectClass":"MindNode","ID":"C5738","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"YS2YD","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"Q45B0","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"7J2M1","lineColorHex":"#26BBFF","text":"进程的初始化，操作系统为进程分配资源、初始化pcb"},"objectClass":"NSArray"},"text":"创建状态"},"1":{"objectClass":"MindNode","ID":"6ZHNK","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"59E78","lineColorHex":"#26BBFF","text":"已经具备运行条件，但由于没有空闲cpu，而暂时不能运行","summarizedNodeID":"1GX59","summarizedText":"三种基本状态"},"objectClass":"NSArray"},"text":"就绪状态"},"2":{"objectClass":"MindNode","ID":"SLICY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"0V42P","lineColorHex":"#26BBFF","text":"占有cpu，并在cpu上运行"},"objectClass":"NSArray"},"text":"运行状态"},"3":{"objectClass":"MindNode","ID":"O36P9","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1GX59","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"13Y22","lineColorHex":"#26BBFF","text":"和就绪区别：就绪获得除cpu以外的所有资源\n                     阻塞依旧在内存中且占有cpu","markType":8},"objectClass":"NSArray"},"text":" 因等待某一事件而暂时不能运行"},"objectClass":"NSArray"},"text":"阻塞状态（等待态）"},"4":{"objectClass":"MindNode","ID":"22PH4","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"UL4X8","lineColorHex":"#26BBFF","text":"进程从系统中共撤销，操作系统会回收进程拥有的资源、撤销pcb"},"objectClass":"NSArray"},"text":"终止状态"},"objectClass":"NSArray"},"text":"状态"},"1":{"objectClass":"MindNode","ID":"SYOQ3","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"U7S1Y","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"L2A5V","lineColorHex":"#26BBFF","text":"进程被调度"},"objectClass":"NSArray"},"text":"就绪--->运行"},"1":{"objectClass":"MindNode","ID":"AV66E","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"SBCQL","lineColorHex":"#26BBFF","text":"时间片到或者cpu被其他更高优先级的进程抢占"},"objectClass":"NSArray"},"text":"运行---->就绪"},"2":{"objectClass":"MindNode","ID":"6NSX3","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"N7257","lineColorHex":"#26BBFF","text":"等待系统资源分配活等待某事件发生（主动行为）"},"objectClass":"NSArray"},"text":"运行--->阻塞"},"3":{"objectClass":"MindNode","ID":"MPP8W","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"C26YI","lineColorHex":"#26BBFF","text":"资源分配到位，等待的事件发生（被动行为）"},"objectClass":"NSArray"},"text":"阻塞--->就绪"},"4":{"objectClass":"MindNode","ID":"0FN7R","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"6J84S","lineColorHex":"#26BBFF","text":"系统完成创建进程的相关操作"},"objectClass":"NSArray"},"text":"创建--->就绪"},"5":{"objectClass":"MindNode","ID":"901J2","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3NU46","lineColorHex":"#26BBFF","text":"进程运行结束或者运行过程中遇到不可修复的错误"},"objectClass":"NSArray"},"text":"运行--->终止"},"objectClass":"NSArray"},"text":"进程状态间的转换"},"objectClass":"NSArray"},"text":"进程状态","shrink":true},"2":{"objectClass":"MindNode","ID":"3O52J","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"82FZN","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"594K1","lineColorHex":"#26BBFF","text":"简言：实现进程状态间的转换"},"objectClass":"NSArray"},"text":"基本概念"},"1":{"objectClass":"MindNode","ID":"N656E","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"7QAU1","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"0159W","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"5ENW5","lineColorHex":"#26BBFF","text":"申请空白pcb "},"1":{"objectClass":"MindNode","ID":"E5626","lineColorHex":"#26BBFF","text":"为新进程分配所需资源"},"2":{"objectClass":"MindNode","ID":"5057L","lineColorHex":"#26BBFF","text":"初始化pcb"},"3":{"objectClass":"MindNode","ID":"PJ3S5","lineColorHex":"#26BBFF","text":"为pcb插入就绪队列"},"objectClass":"NSArray"},"text":"创建原语"},"1":{"objectClass":"MindNode","ID":"20WUS","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"BD5PO","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"J22AY","lineColorHex":"#26BBFF","text":"分时系统中，用户登录成功，系统会建立为其建议一个新的进程"},"objectClass":"NSArray"},"text":"用户登录"},"1":{"objectClass":"MindNode","ID":"U82S6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8SVRV","lineColorHex":"#26BBFF","text":"多道批处理系统中，有新的作业放入内存时，会为其建立一个新点进程"},"objectClass":"NSArray"},"text":"作业调度"},"2":{"objectClass":"MindNode","ID":"C7PO9","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"D31Y1","lineColorHex":"#26BBFF","text":"用户想操作系统提出某些请求时，会新建一个进程处理该请求"},"objectClass":"NSArray"},"text":"提供服务"},"3":{"objectClass":"MindNode","ID":"7OP1A","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3CB67","lineColorHex":"#26BBFF","text":"由用户主动请求创建一个子进程"},"objectClass":"NSArray"},"text":"应用请求"},"objectClass":"NSArray"},"text":"引起进程创建的时间"},"objectClass":"NSArray"},"text":"进程的创建"},"1":{"objectClass":"MindNode","ID":"17737","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"LYDS7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"2MBL6","lineColorHex":"#26BBFF","text":"从pcb集合中找到进程的pcb"},"1":{"objectClass":"MindNode","ID":"YA566","lineColorHex":"#26BBFF","text":"若进程正在运行，立即剥夺cpu，将cpu分配给其他进程"},"2":{"objectClass":"MindNode","ID":"Q974Y","lineColorHex":"#26BBFF","text":"终止其所有子进程"},"3":{"objectClass":"MindNode","ID":"349MK","lineColorHex":"#26BBFF","text":"该进程拥有的所有资源归还给父进程或操作系统"},"4":{"objectClass":"MindNode","ID":"56J20","lineColorHex":"#26BBFF","text":"删除pcb"},"objectClass":"NSArray"},"text":"撤销原语"},"1":{"objectClass":"MindNode","ID":"2OUB6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"43GOO","lineColorHex":"#26BBFF","text":"正常结束"},"1":{"objectClass":"MindNode","ID":"XYBXI","lineColorHex":"#26BBFF","text":"异常结束"},"2":{"objectClass":"MindNode","ID":"A52MV","lineColorHex":"#26BBFF","text":"外界该干预"},"objectClass":"NSArray"},"text":"引起进程终止的事件"},"objectClass":"NSArray"},"text":"进程的终止"},"2":{"objectClass":"MindNode","ID":"5324M","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"37C8L","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"M13D6","lineColorHex":"#26BBFF","text":"找到要阻塞的进程对应的pcb"},"1":{"objectClass":"MindNode","ID":"32D5I","lineColorHex":"#26BBFF","text":"保护进程运行现场，，将pcb状态设置为”阻塞态“，暂时停止进程运行"},"2":{"objectClass":"MindNode","ID":"S38U8","lineColorHex":"#26BBFF","text":"将pcb插入相应的时间的等待队列"},"objectClass":"NSArray"},"text":"阻塞原语"},"1":{"objectClass":"MindNode","ID":"PNIK9","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"318F2","lineColorHex":"#26BBFF","text":"需要等待系统分配某种资源"},"1":{"objectClass":"MindNode","ID":"GHW15","lineColorHex":"#26BBFF","text":"需要等待相互合作的其他进程完成工作"},"objectClass":"NSArray"},"text":"引起进程阻塞的事件"},"objectClass":"NSArray"},"text":"进程的阻塞","summarizedNodeID":"IVW58","summarizedText":"阻塞和唤醒成对出现"},"3":{"objectClass":"MindNode","ID":"IVW58","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"OW77U","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8JSRF","lineColorHex":"#26BBFF","text":"在事件等待队列中找到pcb"},"1":{"objectClass":"MindNode","ID":"X3WX7","lineColorHex":"#26BBFF","text":"将pcb从等待队列移除，设置进程为就绪态"},"2":{"objectClass":"MindNode","ID":"5KRLN","lineColorHex":"#26BBFF","text":"将pcb插入就绪队列，等待被调度"},"objectClass":"NSArray"},"text":"唤醒原语"},"1":{"objectClass":"MindNode","ID":"13MOD","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"L5U5X","lineColorHex":"#26BBFF","text":"等待的事件发生"},"objectClass":"NSArray"},"text":"引起进程唤醒的事件"},"objectClass":"NSArray"},"text":"进程的唤醒"},"4":{"objectClass":"MindNode","ID":"61662","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"QDBE4","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"SWICH","lineColorHex":"#26BBFF","text":"将运行环境信息存入pcb"},"1":{"objectClass":"MindNode","ID":"X49K9","lineColorHex":"#26BBFF","text":"pcb移入相应队列"},"2":{"objectClass":"MindNode","ID":"L7241","lineColorHex":"#26BBFF","text":"选择另一个进程执行，并更新cpu"},"3":{"objectClass":"MindNode","ID":"63O68","lineColorHex":"#26BBFF","text":"根据pcb护肤新进程所需的运行环境"},"objectClass":"NSArray"},"text":"切换原语"},"1":{"objectClass":"MindNode","ID":"R9Q91","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8E29C","lineColorHex":"#26BBFF","text":"当前进程时间片到"},"1":{"objectClass":"MindNode","ID":"KU26T","lineColorHex":"#26BBFF","text":"有更高优先级的进程到达"},"2":{"objectClass":"MindNode","ID":"GI7RH","lineColorHex":"#26BBFF","text":"当前进程主动阻塞"},"3":{"objectClass":"MindNode","ID":"XW6ZF","lineColorHex":"#26BBFF","text":"当前进程终止"},"objectClass":"NSArray"},"text":"引起进程切换的事件"},"objectClass":"NSArray"},"text":"进程的切换"},"objectClass":"NSArray"},"text":"进程控制相关的原语（开中断，关中断---原子操作）"},"objectClass":"NSArray"},"text":"进程控制","shrink":true},"3":{"objectClass":"MindNode","ID":"6TX45","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"YM10L","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"62N6G","lineColorHex":"#26BBFF","text":"进程间的信息交换"},"1":{"objectClass":"MindNode","ID":"1RLB8","lineColorHex":"#26BBFF","text":"为了保证安全，一个进程不能直接访问另\n一个进程的地址空间。\n但是进程之间的信息交换又是必须实现的。\n为了保证进程间的安全通信，操作系统提\n供了一些方法。"},"objectClass":"NSArray"},"text":"概念"},"1":{"objectClass":"MindNode","ID":"B4ZJ4","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XE772","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"QK6F8","lineColorHex":"#26BBFF","text":"设置一个共享空间"},"1":{"objectClass":"MindNode","ID":"W2NZH","lineColorHex":"#26BBFF","text":"要互斥得访问共享空间"},"2":{"objectClass":"MindNode","ID":"XOY51","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"LEY62","lineColorHex":"#26BBFF","text":"基于数据结构的共享"},"1":{"objectClass":"MindNode","ID":"W5Y2P","lineColorHex":"#26BBFF","text":"基于存储区的共享"},"objectClass":"NSArray"},"text":"两种方式"},"objectClass":"NSArray"},"text":"共享存储"},"1":{"objectClass":"MindNode","ID":"DFICN","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"69DVR","lineColorHex":"#26BBFF","text":"“管道”是指用于连接读写进程的一个共享文件，又名pipe文件。其实就是在内存中开辟一个大小固定的缓冲区"},"1":{"objectClass":"MindNode","ID":"P9DPG","lineColorHex":"#26BBFF","text":"1.管道只能采用半双工通信，某一时间段内只能实现单向的传输。如果要实现双向同时通信，则需要设置两个管道。"},"2":{"objectClass":"MindNode","ID":"182SO","lineColorHex":"#26BBFF","text":"2.各进程要互斥地访问管道。"},"3":{"objectClass":"MindNode","ID":"I1825","lineColorHex":"#26BBFF","text":"3.数据以字符流的形式写入管道，当管道写满时，写进程的write()系统调用将被阻塞，等待读进程将数据取走。当读进程将数据全部取走后，管道变空，此时读进程的read()系统调用将被阻塞。（写满不能再写，读空是不能再读）"},"4":{"objectClass":"MindNode","ID":"8ODOR","lineColorHex":"#26BBFF","text":"4.如果没写满，就不允许读。如果没读空，就不允许写。"},"5":{"objectClass":"MindNode","ID":"84VR8","lineColorHex":"#26BBFF","text":"5.数据一旦被读出，就从管道中被抛弃，这就意味着读进程最多只能有一一个，否则可能会有读错数据的情况。"},"objectClass":"NSArray"},"text":"管道通信（pipe）"},"2":{"objectClass":"MindNode","ID":"07B2R","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8D2X8","lineColorHex":"#26BBFF","text":"以格式化的消息为单位，进程通过操作系统提供的”发送/接收“两个原语进行数据交换"},"1":{"objectClass":"MindNode","ID":"V3U22","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"GTP07","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"TC47N","lineColorHex":"#26BBFF","text":"消息直接挂到接收方的消息队列里"},"objectClass":"NSArray"},"text":"直接通信方式"},"1":{"objectClass":"MindNode","ID":"I1O6T","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"83301","lineColorHex":"#26BBFF","text":"消息先发到中间体中（信息）"},"objectClass":"NSArray"},"text":"间接通信方式"},"objectClass":"NSArray"},"text":"两种方式"},"objectClass":"NSArray"},"text":"消息传递(message)"},"objectClass":"NSArray"},"text":"进程通信方法"},"objectClass":"NSArray"},"text":"进程通信","shrink":true},"4":{"objectClass":"MindNode","ID":"VIE66","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1O61M","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"WT64L","lineColorHex":"#26BBFF","text":"按某种算法选择一个进程将处理机分配给它"},"objectClass":"NSArray"},"text":"概念"},"1":{"objectClass":"MindNode","ID":"QAH12","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XE33S","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"KYE3R","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"51G7R","lineColorHex":"#26BBFF","text":"按照某种规则，从后备队列中选择合适的作业将其调入内存，并为其创建进程"},"objectClass":"NSArray"},"text":"任务"},"1":{"objectClass":"MindNode","ID":"LSBIK","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"7M1S5","lineColorHex":"#26BBFF","text":"外存-->内存\n（面向作业）"},"objectClass":"NSArray"},"text":"发生情景"},"2":{"objectClass":"MindNode","ID":"6R796","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"L88HN","lineColorHex":"#26BBFF","text":"最低"},"objectClass":"NSArray"},"text":"发生频率"},"3":{"objectClass":"MindNode","ID":"E1EC6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"B08HO","lineColorHex":"#26BBFF","text":"无-->创建态-->就绪态"},"objectClass":"NSArray"},"text":"对进程的影响"},"objectClass":"NSArray"},"text":"高级调度（作业调度）"},"1":{"objectClass":"MindNode","ID":"RI65I","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"C4C2V","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"16D7C","lineColorHex":"#26BBFF","text":"按照某种规则，从挂起队列中选择合适的进程将其数据调回内存"},"objectClass":"NSArray"},"text":"任务"},"1":{"objectClass":"MindNode","ID":"6DNVV","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"PRA1J","lineColorHex":"#26BBFF","text":"外存-->内存\n（面向进程）"},"objectClass":"NSArray"},"text":"发生情景"},"2":{"objectClass":"MindNode","ID":"UMJB1","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"WKT14","lineColorHex":"#26BBFF","text":"中等"},"objectClass":"NSArray"},"text":"发生频率"},"3":{"objectClass":"MindNode","ID":"7Q7UG","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"I61D7","lineColorHex":"#26BBFF","text":"挂起态-->就绪态\n（阻塞挂起-->阻塞态）"},"objectClass":"NSArray"},"text":"对进程的影响"},"objectClass":"NSArray"},"text":"中级调度（内存调度）"},"2":{"objectClass":"MindNode","ID":"9OD57","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"9L0MN","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"52EU2","lineColorHex":"#26BBFF","text":"按照某种规则，从就绪队列中选择合适的进程为其分配处理机"},"objectClass":"NSArray"},"text":"任务"},"1":{"objectClass":"MindNode","ID":"Q1646","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"GR49U","lineColorHex":"#26BBFF","text":"内存-->cpu"},"objectClass":"NSArray"},"text":"发生情景"},"2":{"objectClass":"MindNode","ID":"44J6O","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"86867","lineColorHex":"#26BBFF","text":"最高"},"objectClass":"NSArray"},"text":"发生频率"},"3":{"objectClass":"MindNode","ID":"DV0CF","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"YMU82","lineColorHex":"#26BBFF","text":"就绪态-->运行态"},"objectClass":"NSArray"},"text":"对进程的影响"},"objectClass":"NSArray"},"text":"低级调度（进程调度）"},"objectClass":"NSArray"},"text":"三个层次","shrink":true},"2":{"objectClass":"MindNode","ID":"HP8R3","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1QJ12","lineColorHex":"#26BBFF","text":"进程的挂起态"},"1":{"objectClass":"MindNode","ID":"FVG62","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"6505C","lineColorHex":"#26BBFF","text":"五状态+就绪挂起+阻塞挂起"},"objectClass":"NSArray"},"text":"七状态模型"},"objectClass":"NSArray"},"text":"补充知识","shrink":true},"3":{"objectClass":"MindNode","ID":"79589","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"F1OK1","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1PLKK","lineColorHex":"#26BBFF","text":"进程正常停止"},"1":{"objectClass":"MindNode","ID":"FZMZ8","lineColorHex":"#26BBFF","text":"运行过程发生异常而终止"},"2":{"objectClass":"MindNode","ID":"W3A66","lineColorHex":"#26BBFF","text":"进程主动请求阻塞（如等待I/O）"},"objectClass":"NSArray"},"text":"进程主动放弃处理机"},"1":{"objectClass":"MindNode","ID":"NQE5J","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"SW1V4","lineColorHex":"#26BBFF","text":"分给进程的时间片用完"},"1":{"objectClass":"MindNode","ID":"KYEDK","lineColorHex":"#26BBFF","text":"有更紧急的事i需要处理（如I/O中断）"},"2":{"objectClass":"MindNode","ID":"WJSN1","lineColorHex":"#26BBFF","text":"有更高优先级的进程进入就绪队列"},"objectClass":"NSArray"},"text":"进程被动放弃处理机"},"objectClass":"NSArray"},"text":"时机","shrink":true},"4":{"objectClass":"MindNode","ID":"1W45O","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"WPRC7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"S294R","lineColorHex":"#26BBFF","text":"在处理中断的过程中。中断处理过程复杂，与硬件密切相关，很难做到在中断处理过程中进行进程切换。"},"1":{"objectClass":"MindNode","ID":"1S6JB","lineColorHex":"#26BBFF","text":"进程在操作系统内核程序临界区中。"},"2":{"objectClass":"MindNode","ID":"B6Y3W","lineColorHex":"#26BBFF","text":"在原子操作过程中(原语)。原子操作不可中断，要一气呵成(如之前讲过的修改PCB中进程状态标志，并把PCB放到相应队列"},"objectClass":"NSArray"},"text":"不能进行进程调度与切换的情况","markType":7},"1":{"objectClass":"MindNode","ID":"P9OQO","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1I2S1","lineColorHex":"#26BBFF","text":"狭义的进程调度指的是从就绪队列中选中一个要运行的进程。(这个进程可以是刚刚被暂停执行的进程，也可能是另一个进程，后一种情况就需要进程切换)"},"1":{"objectClass":"MindNode","ID":"PD3W1","lineColorHex":"#26BBFF","text":"进程切换是指一一个进程让出处理机，由另一个进程占用处理机的过程。"},"objectClass":"NSArray"},"text":"调度和切换的区别"},"2":{"objectClass":"MindNode","ID":"4QJT9","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"64W7Z","lineColorHex":"#26BBFF","text":"对原来运行进程的各种数据的保存"},"1":{"objectClass":"MindNode","ID":"AN2HE","lineColorHex":"#26BBFF","text":"对新的进程各种数据的恢复"},"objectClass":"NSArray"},"text":"切换过程"},"3":{"objectClass":"MindNode","ID":"Q3D73","lineColorHex":"#26BBFF","text":"重要结论：进程调度、切换是有代价的，并不是调度越频繁，并发度越高","markType":8},"objectClass":"NSArray"},"text":"切换与过程","shrink":true},"5":{"objectClass":"MindNode","ID":"3188I","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"T6PZ8","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1D1QH","lineColorHex":"#26BBFF","text":"只能由当前运行的进程主动放弃cpu"},"objectClass":"NSArray"},"text":"非剥夺式调度方式"},"1":{"objectClass":"MindNode","ID":"O93HB","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"5EMI9","lineColorHex":"#26BBFF","text":"可由操作系统剥夺进程的cpu使用权"},"objectClass":"NSArray"},"text":"剥夺调度方式"},"objectClass":"NSArray"},"text":"方式","shrink":true},"6":{"objectClass":"MindNode","ID":"K92L5","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"13745","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"89G87","lineColorHex":"#26BBFF","text":"忙碌时间/总时间"},"objectClass":"NSArray"},"text":"cpu利用率"},"1":{"objectClass":"MindNode","ID":"134O7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"QGWB4","lineColorHex":"#26BBFF","text":"总共完成的作业量/总共花了多少时间 "},"objectClass":"NSArray"},"text":"系统吞吐量"},"2":{"objectClass":"MindNode","ID":"2703S","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"24TTC","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"JW47X","lineColorHex":"#26BBFF","text":"作业时间——作业提交时间"},"objectClass":"NSArray"},"text":"周转时间"},"1":{"objectClass":"MindNode","ID":"13932","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"RJDHS","lineColorHex":"#26BBFF","text":"各作业周转时间之和/作业数"},"objectClass":"NSArray"},"text":"平均周转时间"},"2":{"objectClass":"MindNode","ID":"SC670","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"H041H","lineColorHex":"#26BBFF","text":"作业周转时间/作业实际运行的时间 = 作业完成时间-作业提交时间/作业实际运行的时间"},"objectClass":"NSArray"},"text":"带权周转时间"},"3":{"objectClass":"MindNode","ID":"TA372","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"K0555","lineColorHex":"#26BBFF","text":"各作业带权周转时间之和/作业数"},"objectClass":"NSArray"},"text":"平均带权周转时间"},"objectClass":"NSArray"},"text":"周转时间"},"3":{"objectClass":"MindNode","ID":"LDNI7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"4B66J","lineColorHex":"#26BBFF","text":"进程/作业等待被服务的时间之和"},"1":{"objectClass":"MindNode","ID":"KSL3C","lineColorHex":"#26BBFF","text":"平均等待时间 即各个进程/作业等待时间的平均值"},"objectClass":"NSArray"},"text":"等待时间"},"4":{"objectClass":"MindNode","ID":"JNU78","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"WW96G","lineColorHex":"#26BBFF","text":"从用户提交请求到首次产生响应所用的时间"},"objectClass":"NSArray"},"text":"响应时间"},"objectClass":"NSArray"},"text":"调度算法的评价","shrink":true},"7":{"objectClass":"MindNode","ID":"3WPLK","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"EQVV3","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"5328K","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"4RBCI","lineColorHex":"#26BBFF","text":"主要从“公平”的角度考虑（类似于排队买东西的例子）","maxWidthLine":319},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"264UD","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"Q33OU","lineColorHex":"#26BBFF","text":"按照作业/进程道道的先后顺序进行服务"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"U68GP","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"11DCW","lineColorHex":"#26BBFF","text":"用于作业调度时，考虑的时哪个作业先到达后备队列；用于进程调度时，考虑的是哪个进程先到达就绪队列"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"2MNXL","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"5MB8U","lineColorHex":"#26BBFF","text":"非抢占"},"objectClass":"NSArray"},"text":"是否抢占"},"4":{"objectClass":"MindNode","ID":"4H06C","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"E3746","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"P14SH","lineColorHex":"#26BBFF","text":"公平，算法简单"},"objectClass":"NSArray"},"text":"优"},"1":{"objectClass":"MindNode","ID":"72CSU","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"Z13E4","lineColorHex":"#26BBFF","text":"排在长作业(进程)后面的短作业需要等待很长时间，带权周转时间很大，对短作业来说用户体验不好。即，FCFS算法对长作业有利，对短作业不利(Eg:排队买奶茶.. ."},"objectClass":"NSArray"},"text":"缺"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"QX0FY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3QTN2","lineColorHex":"#26BBFF","text":"否"},"objectClass":"NSArray"},"text":"是否会导致饥饿"},"objectClass":"NSArray"},"text":"先来先服务（FCFS）"},"1":{"objectClass":"MindNode","ID":"HJB53","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"N60DU","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XV2U7","lineColorHex":"#26BBFF","text":"追求最少的平均等待时间，最少的平均周转时间、最少的平均带权周转时间"},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"P22R8","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1YPFT","lineColorHex":"#26BBFF","text":"最短的作业/进程优先得到服务（所谓“最短”，是指要求服务时间最短）"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"2P197","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"6Z88B","lineColorHex":"#26BBFF","text":"都可，用于进程调度时称为“短进程优先算法SPF”"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"0Y733","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"Q3VD5","lineColorHex":"#26BBFF","text":"非抢占，但有抢占式版本---最短剩余时间优先算法"},"objectClass":"NSArray"},"text":"是否可抢占"},"4":{"objectClass":"MindNode","ID":"K212O","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"E9HKK","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"I151L","lineColorHex":"#26BBFF","text":"“最短的”平均等待时间、平均周转时间"},"objectClass":"NSArray"},"text":"优"},"1":{"objectClass":"MindNode","ID":"F775L","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"KOEOH","lineColorHex":"#26BBFF","text":"不公平，对短作业有利，对长作业不利。可能产生饥饿现象。另外，作业/进程的运行时间是由用户提供 的，并不一定真实，不一定能做到真正的短作业优先"},"objectClass":"NSArray"},"text":"缺"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"IQG0S","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"9Y86A","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"S36F2","lineColorHex":"#26BBFF","text":"如果源源不断地有短作业/进程到来，可能使长作业/进程长时间得不到服务，产生“饥饿”现象。如果一直得不到服务，则称为“饿死”"},"objectClass":"NSArray"},"text":"会"},"objectClass":"NSArray"},"text":"是否导致饥饿"},"objectClass":"NSArray"},"text":"短作业优先(SJF)"},"2":{"objectClass":"MindNode","ID":"4QMEY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3I849","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3K5GH","lineColorHex":"#26BBFF","text":"要综合考虑作业/进程的等待时间和要求服务的时间"},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"UTIE6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"2Y9OP","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"M216O","lineColorHex":"#26BBFF","text":"响应比=（等待时间+要求服务时间）/要去服务时间"},"objectClass":"NSArray"},"text":"在每次调度时先计算各个作业。进程的响应比，选择响应比最高的作业。进程为其服务"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"3V8NG","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"M4BHK","lineColorHex":"#26BBFF","text":"都可"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"6QDNX","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"89B8K","lineColorHex":"#26BBFF","text":"非抢占式的算法，因此只有当前运行的作业/进程主动放弃处理机时，才需要调度，才需要计算响应比"},"objectClass":"NSArray"},"text":"是否可抢占"},"4":{"objectClass":"MindNode","ID":"S5KJT","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"83MQH","lineColorHex":"#26BBFF","text":"综合考虑了等待时间和运行时间(要求服务时间)等待时间相同时，要求服务时间短的优先(SJF 的优点)要求服务时间相同时，等待时间长的优先(FCFS 的优点)对于长作业来说，随着等待时间越来越久，其响应比也会越来越大，从而避免了长作业饥饿的问题"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"I472O","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"37PD5","lineColorHex":"#26BBFF","text":"不会"},"objectClass":"NSArray"},"text":"是否导致饥饿"},"objectClass":"NSArray"},"text":"高响应优先（HRRN）"},"3":{"objectClass":"MindNode","ID":"1E8DR","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"77B14","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"QXV8J","lineColorHex":"#26BBFF","text":"公平地，轮流地为各个进程服务，让每个进程在一定时间间隔内都可以得到响应"},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"VWWLT","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"W7154","lineColorHex":"#26BBFF","text":"按照各进程到达就绪队列的顺序，轮流让各个进程执行一个时间片（如100ms）。托进程未在一个时间片内执行完，则剥夺处理机，将进程重新放到就绪队列尾重新排队"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"2GN1U","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"F5GHB","lineColorHex":"#26BBFF","text":"用于进程调度（只有作业放入内存建立了相应的进程后，才能被分配处理机时间片）"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"6OS63","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"370SK","lineColorHex":"#26BBFF","text":"若进程未能在时间片内运行完，将被强行剥夺处理机使用权，因此时间片轮转调度算法属于抢占式的算法。由时钟装置发出实在中转来通知cpu时间片已到"},"objectClass":"NSArray"},"text":"是否可抢占"},"4":{"objectClass":"MindNode","ID":"3V569","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3D545","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"DUT18","lineColorHex":"#26BBFF","text":"公平，响应快，适用于分时操作系统"},"objectClass":"NSArray"},"text":"优"},"1":{"objectClass":"MindNode","ID":"GL3QE","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"KO51F","lineColorHex":"#26BBFF","text":"由于高频率的进程切换，因此有一定开销，不区分任务的紧急程度"},"objectClass":"NSArray"},"text":"缺"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"2M41O","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"J7OL6","lineColorHex":"#26BBFF","text":"否"},"objectClass":"NSArray"},"text":"是否会导致饥饿"},"objectClass":"NSArray"},"text":"时间片轮转"},"4":{"objectClass":"MindNode","ID":"9N151","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"OL1H7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"57KS0","lineColorHex":"#26BBFF","text":"随着计算机的发展，特别是实时操作系统的出现，越来越多的应用场景需要根据任务来决定处理顺序"},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"7JY1N","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"0C4C9","lineColorHex":"#26BBFF","text":"每个作业/进程有各自的优先级，调度时选择优先级最高的作业/进程"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"4J2J2","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"J172O","lineColorHex":"#26BBFF","text":"都可"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"13852","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"9552O","lineColorHex":"#26BBFF","text":"都有 \n非抢占式秩序在进程主动放弃处理机时进行调度即可，而抢占式还需在就绪队列变化时，检查是否会发生抢占"},"objectClass":"NSArray"},"text":"是否可抢占"},"4":{"objectClass":"MindNode","ID":"WN31M","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"E4LS4","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"72S83","lineColorHex":"#26BBFF","text":"用优先级区分紧急程度、重要程度，适用于实时操作系统。可灵活地调整对各种作业/进程的偏好程度"},"objectClass":"NSArray"},"text":"优"},"1":{"objectClass":"MindNode","ID":"771PV","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"FC1E4","lineColorHex":"#26BBFF","text":"若源源不断地优优先级进程进来，则可能导致饥饿"},"objectClass":"NSArray"},"text":"缺"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"33622","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"M10AH","lineColorHex":"#26BBFF","text":"会"},"objectClass":"NSArray"},"text":"是否会导致饥饿"},"objectClass":"NSArray"},"text":"优先级调度算法"},"5":{"objectClass":"MindNode","ID":"VW6YY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1I481","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"H8CH5","lineColorHex":"#26BBFF","text":"对其他调度算法的折中权衡"},"objectClass":"NSArray"},"text":"算法思想"},"1":{"objectClass":"MindNode","ID":"45087","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"H462E","lineColorHex":"#26BBFF","text":"1. 设置多级就绪队列，各级队列优先级从高到低，时间片从小到大"},"1":{"objectClass":"MindNode","ID":"4GX3P","lineColorHex":"#26BBFF","text":"2. 新进程到达时先进入第一级队列，按FCFS原则排队被分配时间片，若用完时间片进程还未结束，则进程进入下一级队队尾"},"2":{"objectClass":"MindNode","ID":"X75JW","lineColorHex":"#26BBFF","text":"3. 只有第K级队列为空，才会为k+1级对头的进程分配时间片"},"objectClass":"NSArray"},"text":"算法规则"},"2":{"objectClass":"MindNode","ID":"81J21","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"BG8NX","lineColorHex":"#26BBFF","text":"用于进程调度"},"objectClass":"NSArray"},"text":"用于作业/进程调度"},"3":{"objectClass":"MindNode","ID":"4DLF5","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"34EP2","lineColorHex":"#26BBFF","text":"抢占式算法，在k级队列的进程运行过程中，若更上级的队列（1~k-1级）中进入了一个新进程，则由于新进程处于优先级更高的队列中，因此新进程会抢占处理机，原来运行的进程放回k级队列对位"},"objectClass":"NSArray"},"text":"是否可抢占"},"4":{"objectClass":"MindNode","ID":"VU4F1","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1JXTK","lineColorHex":"#26BBFF","text":"对各类型进程相对公平(FCFS的优点) ;每个新到达的进程都可以很快就得到响应(RR的优点) ;短进程只用较少的时间就可完成(SPF的优点) ;不必实现估计进程的运行时间(避免用户作假) ;\n可灵活地调整对各类进程的偏好程度，比CPU密集型进程、I/O密集型进程(拓展:可以将因I/O而阻塞的进程重新放回原队列，这样/0型进程就可以保持较高优先级)"},"objectClass":"NSArray"},"text":"优缺点"},"5":{"objectClass":"MindNode","ID":"S9Z5J","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"388EI","lineColorHex":"#26BBFF","text":"会"},"objectClass":"NSArray"},"text":"是否导致饥饿"},"objectClass":"NSArray"},"text":"多级反馈队列调度算法"},"objectClass":"NSArray"},"text":"调度算法 "},"objectClass":"NSArray"},"text":"调度","shrink":true},"5":{"objectClass":"MindNode","ID":"48167","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"A4828","lineColorHex":"#26BBFF","text":"并发性带来了异步性，有时需要通过进程同步解决这种异步问题，有点进程之间需要相互配合得完成工作，各进程的工作推进选用遵循一定的先后顺序"},"objectClass":"NSArray"},"text":"进程同步","shrink":true},"6":{"objectClass":"MindNode","ID":"RD5UM","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8TI76","lineColorHex":"#26BBFF","text":"对临界资源的访问，需要互斥地进行，即同一时间段内只允许一个进程访问该资源"},"1":{"objectClass":"MindNode","ID":"U7747","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"Y2H03","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"GJ82H","lineColorHex":"#26BBFF","text":"检查是否进入临界区，若可进入，需要“上锁”"},"objectClass":"NSArray"},"text":"进入区"},"1":{"objectClass":"MindNode","ID":"2E8HY","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"2YUPC","lineColorHex":"#26BBFF","text":"访问临界资源的那段代码"},"objectClass":"NSArray"},"text":"临界区"},"2":{"objectClass":"MindNode","ID":"E2XNE","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"30WRC","lineColorHex":"#26BBFF","text":"负责”解锁“"},"objectClass":"NSArray"},"text":"退出区"},"3":{"objectClass":"MindNode","ID":"IJ6F6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"2ZY60","lineColorHex":"#26BBFF","text":"其余代码部分"},"objectClass":"NSArray"},"text":"剩余区"},"objectClass":"NSArray"},"text":"四个部分","shrink":true},"2":{"objectClass":"MindNode","ID":"2VIRF","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XU4MJ","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"E46T3","lineColorHex":"#26BBFF","text":"临界区空闲时，应允许一个进程访问"},"objectClass":"NSArray"},"text":"空闲让进"},"1":{"objectClass":"MindNode","ID":"61XKI","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"333G4","lineColorHex":"#26BBFF","text":"临界区正在被访问时，其他试图访问的进程需要等待"},"objectClass":"NSArray"},"text":"忙则等待"},"2":{"objectClass":"MindNode","ID":"B2483","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"XHV2L","lineColorHex":"#26BBFF","text":"要在有限时间内进入临界区，保证不被饥饿"},"objectClass":"NSArray"},"text":"有限等待"},"3":{"objectClass":"MindNode","ID":"1NIK6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"42Y1J","lineColorHex":"#26BBFF","text":"进不了临界区 的进程，要释放处理机，防止忙等"},"objectClass":"NSArray"},"text":"让权等待"},"objectClass":"NSArray"},"text":"需要遵循的原则","shrink":true},"3":{"objectClass":"MindNode","ID":"F776E","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"X6G3N","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"4FI7X","lineColorHex":"#26BBFF","text":"在进入区只做”检查“，不  ”上锁“"},"1":{"objectClass":"MindNode","ID":"46Y3W","lineColorHex":"#26BBFF","text":"在退出区把临界区的使用权转交给另一个进程\n（相当于在退出区既给另一个进程”上锁“，又给自己”上锁“）"},"2":{"objectClass":"MindNode","ID":"7N2S0","lineColorHex":"#26BBFF","text":"主要问题：不遵循”空闲让进“原则"},"objectClass":"NSArray"},"text":"单标志法"},"1":{"objectClass":"MindNode","ID":"43UGJ","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"02PV6","lineColorHex":"#26BBFF","text":"在进入区先”检查“后”上锁“，退出区”解锁“"},"1":{"objectClass":"MindNode","ID":"CM5R2","lineColorHex":"#26BBFF","text":"主要问题：不遵循”忙则等待“原则"},"objectClass":"NSArray"},"text":"双标志先检查"},"2":{"objectClass":"MindNode","ID":"M7832","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"8MP24","lineColorHex":"#26BBFF","text":"在进入区先”加锁“后”检查“，退出区”解锁“"},"1":{"objectClass":"MindNode","ID":"3378W","lineColorHex":"#26BBFF","text":"主要问题：不遵循”空闲让进、有限等待“原则，可能导致”饥饿“"},"objectClass":"NSArray"},"text":"双标志后检查"},"3":{"objectClass":"MindNode","ID":"096I0","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"06J13","lineColorHex":"#26BBFF","text":"在进入区”主动争取--主动谦让--检查对方是否想进、乙方是否谦让“"},"1":{"objectClass":"MindNode","ID":"7D1W0","lineColorHex":"#26BBFF","text":"主要问日：不遵循”让权等待“原则，会发生”忙等“"},"objectClass":"NSArray"},"text":"Peterson算法"},"objectClass":"NSArray"},"text":"互斥的软件实现方法","shrink":true},"4":{"objectClass":"MindNode","ID":"HXPE3","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"31AT7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"667TR","lineColorHex":"#26BBFF","text":"使用”开/关中断“指定实现"},"1":{"objectClass":"MindNode","ID":"L47CF","lineColorHex":"#26BBFF","text":"优先：简单高效"},"2":{"objectClass":"MindNode","ID":"F94J7","lineColorHex":"#26BBFF","text":"缺点：只适用于单处理机；只适用于操作系统内核进程"},"objectClass":"NSArray"},"text":"中断屏蔽方法"},"1":{"objectClass":"MindNode","ID":"6BI32","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"JTHF1","lineColorHex":"#26BBFF","text":"old记录是否上锁\n再将lock设为true\n检查临界区是否已被上锁\n（若已上锁，则循环重复前几步）"},"1":{"objectClass":"MindNode","ID":"QFLNX","lineColorHex":"#26BBFF","text":"优点：实现简单；适用于多处理机环境"},"2":{"objectClass":"MindNode","ID":"788V5","lineColorHex":"#26BBFF","text":"缺点：不满足”让权等待“"},"objectClass":"NSArray"},"text":"TestAndSet（TS指令/TSL指令）"},"2":{"objectClass":"MindNode","ID":"23Q15","lineColorHex":"#26BBFF","text":"Swap指令（XCHG指令）   逻辑上同TSL","linkPaths":{"0":{"objectClass":"NodeLinkPath","ID":"6BI32","ctrlPoint":{"objectClass":"CGPoint","x":0,"y":0}},"objectClass":"NSArray"}},"objectClass":"NSArray"},"text":"互斥的硬件实现方法"},"objectClass":"NSArray"},"text":"进程互斥","shrink":true},"7":{"objectClass":"MindNode","ID":"HJNO7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"1773Y","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"54MV4","lineColorHex":"#26BBFF","text":"用户进程可以通过使用操作系统提供的--对原语来对信号量进行操作，从而很方便的实现了进程互斥、进程同步。"},"1":{"objectClass":"MindNode","ID":"6386H","lineColorHex":"#26BBFF","text":"信号量其实就是一个变量(可以是-一个整数，也可以是更复杂的记录型变量)，可以用一个信号量来表示系统中某种资源的数量，比如:系统中只有一台打印机，就可以设置-一个初值为1的信号量。原语是一种特殊的程序段，其执行只能一气呵成，不可被中断。"},"2":{"objectClass":"MindNode","ID":"QZ23Q","lineColorHex":"#26BBFF","text":"原语是由关中断/开中断指令实现的。软件解决方案的主要问题是由“进入区的各种操作无法- -气呵成\"，因此如果能把进入区、退出区的操作都用“原语”实现，使这些操作能“一气呵成”就能避免问题。"},"3":{"objectClass":"MindNode","ID":"57XV6","lineColorHex":"#26BBFF","text":"一对原语: .\nwait(S)原语和sigal(S)原语，可以把原语理解为我们自己写的函数，函数名分别为wait\n和signal,括号里的信号量S其实就是函数调用时传入的一个参数。wait、signal 原语常简称为P、V操作(来自荷兰proberenverhogen)。因此，做题的时候常把wait(S)、signal(S) 两个操作分别写为P(S)、V(S)"},"objectClass":"NSArray"},"text":"概念","shrink":true},"1":{"objectClass":"MindNode","ID":"54245","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"3098E","lineColorHex":"#26BBFF","text":"用一个整数型的变量作为信号量，用来表示系统中某种资源的数量"},"1":{"objectClass":"MindNode","ID":"976UV","lineColorHex":"#26BBFF","text":"整型信号量与普通整型变量的区别：对信号量只能执行初始化、P、V三种操作"},"2":{"objectClass":"MindNode","ID":"825NV","lineColorHex":"#26BBFF","text":"整型信号量存在的问题：不满足让权等待原则"},"objectClass":"NSArray"},"text":"整形信号量"},"2":{"objectClass":"MindNode","ID":"WR2Q7","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"F2I57","lineColorHex":"#26BBFF","text":"S.value表示某种资源数，S,L指向等待该资源的队列"},"1":{"objectClass":"MindNode","ID":"23G4S","lineColorHex":"#26BBFF","text":"P操作中，一定时先S.value--,之后可能需要执行block原语"},"2":{"objectClass":"MindNode","ID":"9Y64F","lineColorHex":"#26BBFF","text":"V操作中，一定时先S.value++,之后可能需要执行wakeup原语"},"3":{"objectClass":"MindNode","ID":"AEPUV","lineColorHex":"#26BBFF","text":"注意：要能够自行推断在什么条件下需要执行block或wakeup","markType":7},"4":{"objectClass":"MindNode","ID":"7E0VM","lineColorHex":"#26BBFF","text":"可以用纪录型信号量实现系统资源的”申请“和“释放”"},"5":{"objectClass":"MindNode","ID":"TE89Q","lineColorHex":"#26BBFF","text":"可以用纪录型信号量实现进程互斥、进程同步"},"objectClass":"NSArray"},"text":"纪录型信号量"},"3":{"objectClass":"MindNode","ID":"Q8KI6","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"L6H8G","lineColorHex":"#26BBFF","text":"分析问题，确定临界区"},"1":{"objectClass":"MindNode","ID":"YF06V","lineColorHex":"#26BBFF","text":"设置互斥信号量，初值为1"},"2":{"objectClass":"MindNode","ID":"709H9","lineColorHex":"#26BBFF","text":"临界区之前对信号量执行P操作"},"3":{"objectClass":"MindNode","ID":"N767O","lineColorHex":"#26BBFF","text":"临界区之后对信号量执行V操作"},"objectClass":"NSArray"},"text":"信号量机制实现进程互斥"},"4":{"objectClass":"MindNode","ID":"1540C","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"FZ162","lineColorHex":"#26BBFF","text":"分析问题，找出哪里需要实现”一前一后“的同步关系"},"1":{"objectClass":"MindNode","ID":"23XBT","lineColorHex":"#26BBFF","text":"设置同步信号量，初始值为0"},"2":{"objectClass":"MindNode","ID":"0LA78","lineColorHex":"#26BBFF","text":"在”前操作“之后执行V操作"},"3":{"objectClass":"MindNode","ID":"6CPH5","lineColorHex":"#26BBFF","text":"在”后操作“之前执行P操作"},"objectClass":"NSArray"},"text":"信号量机制实现进程同步"},"5":{"objectClass":"MindNode","ID":"8258R","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"N70U0","lineColorHex":"#26BBFF","text":"分析问题，画出前驱图，把每一对前驱关系都看成一个同步问题"},"1":{"objectClass":"MindNode","ID":"427H2","lineColorHex":"#26BBFF","text":"为每一对前驱关系涉资同步信号量，初值为0"},"2":{"objectClass":"MindNode","ID":"84VEY","lineColorHex":"#26BBFF","text":"在每个”前操作“之后执行V操作"},"3":{"objectClass":"MindNode","ID":"433M8","lineColorHex":"#26BBFF","text":"在每个”后操作“之前执行P操作"},"objectClass":"NSArray"},"text":"信号量机制实现进程前驱关系"},"objectClass":"NSArray"},"text":"信号量机制","shrink":true},"8":{"objectClass":"MindNode","ID":"M0R38","lineColorHex":"#26BBFF","text":"生产者--消费者问题"},"9":{"objectClass":"MindNode","ID":"2MSMD","lineColorHex":"#26BBFF","text":"多生产者--多消费者问题"},"10":{"objectClass":"MindNode","ID":"J5JMC","lineColorHex":"#26BBFF","text":"吸烟者问题"},"11":{"objectClass":"MindNode","ID":"8EA83","lineColorHex":"#26BBFF","text":"读者--写者问题"},"12":{"objectClass":"MindNode","ID":"YE320","lineColorHex":"#26BBFF","text":"哲学家进餐问题"},"objectClass":"NSArray"},"text":"进程"},"2":{"objectClass":"MindNode","ID":"8859U","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"3V4JJ","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"168ID","lineColorHex":"#37C45A","text":"”轻量级进程“"},"1":{"objectClass":"MindNode","ID":"4LA6H","lineColorHex":"#37C45A","text":"cpu执行的基本单位，程序执行流的最小单位"},"2":{"objectClass":"MindNode","ID":"XFC94","lineColorHex":"#37C45A","text":"引入线程之后，不仅是进程之间\n可以并发，进程内的各线程之间\n也可以并发，从而进一步提升了\n系统的并发度，使得一个进程内\n也可以并发处理各种任务( 如QQ\n视频、文字聊天、传文件)"},"3":{"objectClass":"MindNode","ID":"NUY7Q","lineColorHex":"#37C45A","text":"引入线程后，进程只作为除CPU之\n外的系统资源的分配单元(如打\n印机、内存地址空间等都是分配\n给进程的)。"},"objectClass":"NSArray"},"text":"概念"},"1":{"objectClass":"MindNode","ID":"97LW5","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"155J8","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"5EO31","lineColorHex":"#26BBFF","text":"传统进程机制中，进程是资源分配、调度的基本单位"},"1":{"objectClass":"MindNode","ID":"45LSB","lineColorHex":"#26BBFF","text":"引入线程后，进程是资源分配的基本单位、线程是调度的基本单位"},"objectClass":"NSArray"},"text":"资源分配、调度"},"1":{"objectClass":"MindNode","ID":"8W1OP","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"KB831","lineColorHex":"#26BBFF","text":"传统进程机制中，只能进程间并发"},"1":{"objectClass":"MindNode","ID":"6P67P","lineColorHex":"#26BBFF","text":"引入线程后，各进程间也能并发，提升并发度"},"objectClass":"NSArray"},"text":"并发性"},"2":{"objectClass":"MindNode","ID":"C918R","lineColorHex":"#26BBFF","children":{"0":{"objectClass":"MindNode","ID":"E25M5","lineColorHex":"#26BBFF","text":"传统的进程间并发需要切换进程的运行环境，系统开销大"},"1":{"objectClass":"MindNode","ID":"45463","lineColorHex":"#26BBFF","text":"线程间并发，如果是统一进程内的线程切换，则不需要切换进程环境，系统开销小"},"2":{"objectClass":"MindNode","ID":"5861I","lineColorHex":"#26BBFF","text":"引入线程后，并发带来的系统开销减少"},"objectClass":"NSArray"},"text":"系统开销"},"objectClass":"NSArray"},"text":"带来的变化","shrink":true},"2":{"objectClass":"MindNode","ID":"FP53L","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"D584T","lineColorHex":"#26BBFF","text":"线程是cpu调度的单位"},"1":{"objectClass":"MindNode","ID":"56HE7","lineColorHex":"#26BBFF","text":"多cpu计算机中，各个cpu可占用不同的cpu"},"2":{"objectClass":"MindNode","ID":"24YC7","lineColorHex":"#26BBFF","text":"每个线程逗游一个线程id，线程控制块（TCP）"},"3":{"objectClass":"MindNode","ID":"CR37Y","lineColorHex":"#26BBFF","text":"每个线程都有就绪、阻塞、运行三种基本状态"},"4":{"objectClass":"MindNode","ID":"D38SF","lineColorHex":"#26BBFF","text":"线程几乎不拥有系统资源"},"5":{"objectClass":"MindNode","ID":"66RNB","lineColorHex":"#26BBFF","text":"同一进程的不同线程间共享进程的资源"},"6":{"objectClass":"MindNode","ID":"O32HQ","lineColorHex":"#26BBFF","text":"由于共享内存地址空间，同一进程中的线程间通信甚至无需系统干预"},"7":{"objectClass":"MindNode","ID":"E915J","lineColorHex":"#26BBFF","text":"同一进程中的线程切换，不会引起进程切换"},"8":{"objectClass":"MindNode","ID":"V3ZT6","lineColorHex":"#26BBFF","text":"不同进程中的线程切换，会引起进程切换"},"9":{"objectClass":"MindNode","ID":"K2QWO","lineColorHex":"#26BBFF","text":"切换同进程内的线程，系统开销很小"},"10":{"objectClass":"MindNode","ID":"65S82","lineColorHex":"#26BBFF","text":"切换进程，系统开销较大"},"objectClass":"NSArray"},"text":"属性","shrink":true},"3":{"objectClass":"MindNode","ID":"60Z7Y","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"U745C","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"4F202","lineColorHex":"#37C45A","text":"用户级线程由应用程序通过线程库实现。\n所有的线程管理工作都由应用程序负责(包\n括线程切换)\n用户级线程中，线程切换可以在用户态下即\n可完成，无需操作系统干预。\n在用户看来，是有多个线程。但是在操作系\n统内核看来，并意识不到线程的存在。(用\n户级线程对用户不透明，对操作系统透明)\n\n可以这样理解，“用户级线程” 就是“从用\n户视角看能看到的线程"},"objectClass":"NSArray"},"text":"用户级线程"},"1":{"objectClass":"MindNode","ID":"XEOYK","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"3W384","lineColorHex":"#37C45A","text":"内核级线程的管理工作由操作系统内核完成。\n线程调度、切换等工作都由内核负责，因此.\n内核级线程的切换必然需要在核心态下才能\n完成。\n可以这样理解，“内核级线程” 就是“从操\n作系统内核视角看能看到的线程”"},"objectClass":"NSArray"},"text":"内核级线程（cpu分配的单位）"},"objectClass":"NSArray"},"text":"实现方式"},"4":{"objectClass":"MindNode","ID":"L16TO","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"34CC2","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"M28H4","lineColorHex":"#37C45A","text":"多对一模型:多个用户及线程映射到一个内核级线程。每个用户进程只对应一个内核级线程。"},"1":{"objectClass":"MindNode","ID":"S5IE4","lineColorHex":"#37C45A","text":"优点:\n用户级线程的切换在用户空间即可完成，不需要切换到核心态，线程管理的系统开销小，效率高"},"2":{"objectClass":"MindNode","ID":"52PV5","lineColorHex":"#37C45A","text":"缺点:\n当一个用户级线程被阻塞后，整个进程都会被阻塞，并发度不高。多个线程不可在多核处理机上并行运行"},"objectClass":"NSArray"},"text":"多对一模型"},"1":{"objectClass":"MindNode","ID":"7086P","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"4K17S","lineColorHex":"#37C45A","text":"一对一模型:一个用户及线程映射到一个内核级线程。每个用户进程有与用户级线程同数量的内核级线程。"},"1":{"objectClass":"MindNode","ID":"B466T","lineColorHex":"#37C45A","text":"优点:\n当一个线程被阻塞后，别的线程还可\n以继续执行，并发能力强。多线程可在多核\n处理机上并行执行。"},"2":{"objectClass":"MindNode","ID":"1A666","lineColorHex":"#37C45A","text":"缺点:\n一个用户进程会占用多个内核级线程，线程切换由操作系统内核完成，需要切换到核心态，因此线程管理的成本高，开销大"},"objectClass":"NSArray"},"text":"一对一模型"},"2":{"objectClass":"MindNode","ID":"577GT","lineColorHex":"#37C45A","children":{"0":{"objectClass":"MindNode","ID":"OQR2O","lineColorHex":"#37C45A","text":"多对多模型: n用户及线程映射到m个内核\n级线程(n>=m)。每个用户进程对应m个\n内核级线程。"},"1":{"objectClass":"MindNode","ID":"1Q81L","lineColorHex":"#37C45A","text":"克服了多对一模型并发度不高的缺点，又克\n服了一对一模型中一个用户进程占用太多内\n核级线程，开销太大的缺点。"},"objectClass":"NSArray"},"text":"多对多模型"},"objectClass":"NSArray"},"text":"多线程模型"},"objectClass":"NSArray"},"text":"线程","shrink":true},"3":{"objectClass":"MindNode","ID":"1B2LG","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"IGWE0","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"4N7I8","lineColorHex":"#FFC700","text":"解决信号量机子编程蛮麻烦、易出错的问题"},"objectClass":"NSArray"},"text":"为什么要引入管程"},"1":{"objectClass":"MindNode","ID":"2378I","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"BH49R","lineColorHex":"#FFC700","text":"共享数据结构"},"1":{"objectClass":"MindNode","ID":"4D14K","lineColorHex":"#FFC700","text":"对数据结构初始化的语句"},"2":{"objectClass":"MindNode","ID":"5H946","lineColorHex":"#FFC700","text":"一组用来访问数据结构的过程（函数）"},"objectClass":"NSArray"},"text":"组成"},"2":{"objectClass":"MindNode","ID":"69ZG5","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"40J1M","lineColorHex":"#FFC700","text":"各外部进程/线程只能通过管程提供的特定”入口“才能访问共享数据"},"1":{"objectClass":"MindNode","ID":"MJ6B6","lineColorHex":"#FFC700","text":"每次仅允许一个进程在管程内执行某个内部过程"},"objectClass":"NSArray"},"text":"基本特征"},"3":{"objectClass":"MindNode","ID":"EV8F1","lineColorHex":"#FFC700","text":"拓展1：用管程解决生产者消费者问题"},"4":{"objectClass":"MindNode","ID":"J6P83","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"5M0NY","lineColorHex":"#FFC700","text":"sychronized"},"objectClass":"NSArray"},"text":"拓展2：java中类似管程的机制"},"5":{"objectClass":"MindNode","ID":"2XL75","lineColorHex":"#FFC700","children":{"0":{"objectClass":"MindNode","ID":"5G5BN","lineColorHex":"#FFC700","text":"各进程必须互斥访问管程的特性是由编译器实现的"},"1":{"objectClass":"MindNode","ID":"47Q1Q","lineColorHex":"#FFC700","text":"可在管程中设置条件变量及等待/唤醒操作以解决同步问题"},"objectClass":"NSArray"},"text":"补充"},"objectClass":"NSArray"},"text":"管程","shrink":true},"4":{"objectClass":"MindNode","ID":"68U32","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"TL4BO","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"K37R1","lineColorHex":"#1BD6E7","text":"各进程互相等待对方手里的资源释放，导致各进程都阻塞，无法向前推进的现象"},"objectClass":"NSArray"},"text":"概念"},"1":{"objectClass":"MindNode","ID":"8JH39","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"2J8QG","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"Z634S","lineColorHex":"#1BD6E7","text":"都是进程无法顺利向前推进的现象（故意设计的思想和除外）"},"objectClass":"NSArray"},"text":"共同点"},"1":{"objectClass":"MindNode","ID":"86B77","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"YL491","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"XG466","lineColorHex":"#1BD6E7","text":"死锁一定时”循环等待对方手里的资源“导致的，因此有死锁现象，按至少有两个或两个以上的进程同时发生死锁。另外，发生死锁的进程一定处于阻塞态"},"objectClass":"NSArray"},"text":"死锁"},"1":{"objectClass":"MindNode","ID":"43RSH","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"9N1T5","lineColorHex":"#1BD6E7","text":"可能只有一个进程发生饥饿，发生饥饿的进程既可能是阻塞态（如长时间得不到需要的I/o\n设备），也可能时就绪态（长期得不到处理机）"},"objectClass":"NSArray"},"text":"饥饿"},"2":{"objectClass":"MindNode","ID":"597T7","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"82IVB","lineColorHex":"#1BD6E7","text":"可能只有一个进程发生死循环。死循环的进程可以上处理机运行（可以是运行态），只不过无法像期待的那样顺利推进。死锁和饥饿问题是由于操作系统分配资源的策略不合理导致的，而死循环是由代码逻辑的错误导致的。死锁和饥饿是管理者（操作系统）的问题，死循环是被管理者的问题 "},"objectClass":"NSArray"},"text":"死循环"},"objectClass":"NSArray"},"text":"不同点"},"objectClass":"NSArray"},"text":"死锁、饥饿、死循环的区别"},"2":{"objectClass":"MindNode","ID":"DUFH2","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"Z0M74","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"UL6VE","lineColorHex":"#1BD6E7","text":"只有对必须互斥使用的资源的争抢才会导致死锁"},"objectClass":"NSArray"},"text":"互斥条件"},"1":{"objectClass":"MindNode","ID":"LLB2K","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"KYVKK","lineColorHex":"#1BD6E7","text":"进程所获得的资源在未使之前，不能由其他进程强行夺走，只能主动释放"},"objectClass":"NSArray"},"text":"不剥夺条件"},"2":{"objectClass":"MindNode","ID":"7G7NH","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"KPB33","lineColorHex":"#1BD6E7","text":"进程已经保持了至少一个资源，但又提出了新的资源请求，而该资源又被其他进程占有，此时请求进程被阻塞，但又对自己已有的资源保持不放"},"objectClass":"NSArray"},"text":"请求和保持条件"},"3":{"objectClass":"MindNode","ID":"N3II6","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"Y06Z5","lineColorHex":"#1BD6E7","text":"存在一种进程资源的循环等待链，链中的每一个进程已获得的资源同时被下一个进程所请求"},"objectClass":"NSArray"},"text":"循环等待条件"},"4":{"objectClass":"MindNode","ID":"L7XFP","lineColorHex":"#1BD6E7","text":"发生死锁一定有循环等待，发生循环等待未必死锁","markType":7},"objectClass":"NSArray"},"text":"死锁产生的必要条件"},"3":{"objectClass":"MindNode","ID":"ROTP1","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"746PC","lineColorHex":"#1BD6E7","text":"对不可剥夺资源的不合理分配，可能导致死锁"},"objectClass":"NSArray"},"text":"发生死锁的情景"},"4":{"objectClass":"MindNode","ID":"LU895","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"Y9M19","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"8KSV3","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"42231","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"D0H12","lineColorHex":"#1BD6E7","text":"把只能互斥使用的资源改造成运行共享使用\n  e.g   spooling将打印机改造成共享设备"},"1":{"objectClass":"MindNode","ID":"YWP68","lineColorHex":"#1BD6E7","text":"缺点：可行性不高，很多时候无法破坏互斥条件"},"objectClass":"NSArray"},"text":"破坏互斥条件"},"1":{"objectClass":"MindNode","ID":"N5L77","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"T568S","lineColorHex":"#1BD6E7","text":"方案一:  申请的资源得不到满足时，立即释放拥有的所有资源"},"1":{"objectClass":"MindNode","ID":"QT556","lineColorHex":"#1BD6E7","text":"方案二：申请的资源被其他进程占用时，由操作系统吸住剥夺（考虑优先级）"},"2":{"objectClass":"MindNode","ID":"U0B88","lineColorHex":"#1BD6E7","text":"缺点：实现复杂；剥夺资源可能导致部分工作失效；反复申请和释放导致系统开销大；可能导致饥饿"},"objectClass":"NSArray"},"text":"破坏不剥夺条件"},"2":{"objectClass":"MindNode","ID":"KG46R","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"5LN15","lineColorHex":"#1BD6E7","text":"可以采用静态分配方法，运行前分配好所需要的资源，之后一直保持"},"1":{"objectClass":"MindNode","ID":"T9ER4","lineColorHex":"#1BD6E7","text":"缺点：资源利用率低；可能导致饥饿"},"objectClass":"NSArray"},"text":"破坏请求和保持条件"},"3":{"objectClass":"MindNode","ID":"C44Z2","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"B8635","lineColorHex":"#1BD6E7","text":"可以采用顺序资源分配法。给资源编号，必须按编号从小到大的顺序申请资源"},"1":{"objectClass":"MindNode","ID":"UF5VJ","lineColorHex":"#1BD6E7","text":"缺点：不方便增加新设备；会导致资源浪费；用户编程麻烦"},"objectClass":"NSArray"},"text":"破坏循环等待条件"},"objectClass":"NSArray"},"text":"破坏死锁产生的四个必要条件"},"objectClass":"NSArray"},"text":"预防死锁"},"1":{"objectClass":"MindNode","ID":"GM284","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"V5QK2","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"YQI4X","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"0BM99","lineColorHex":"#1BD6E7","text":"能完美解决所有进程的序列（进程的排序）就成为安全序列！m"},"objectClass":"NSArray"},"text":"什么是安全序列"},"1":{"objectClass":"MindNode","ID":"TVEY5","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"RM459","lineColorHex":"#1BD6E7","text":"如果分配了资源之后，系统中找不出任何一个安全序列，系统就进入了不安全状态。这就意味着之后可能所有进程都无法顺利的执行下去。当然，如果有进程提前归还了一些资源，那系统也有可能重新回到安全状态，不过我们在分配资源之前总是要考虑到最坏的情况。\n如果系统处于安全状态，就一定不会发生死锁。如果系统进入不安全状态，就可能发生死锁(处于不安全状态未必就是发生了死锁，但发生死锁时一-定是在不安全状态)因此可以在资源分配之前预先判断这次分配是否会导致系统进入不安全状态，以此决定是否答应资源分配请求。这也是“银行家算法”的核心思想。"},"objectClass":"NSArray"},"text":"什么是系统的不安全状态，与死锁有何联系"},"2":{"objectClass":"MindNode","ID":"MB7AI","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"4314T","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"MV1UJ","lineColorHex":"#1BD6E7","text":"长度为m的一维数组Available表示还有多少可用资源"},"1":{"objectClass":"MindNode","ID":"VY94R","lineColorHex":"#1BD6E7","text":"n*m矩阵Max表示各进程对资源的最大需求数"},"2":{"objectClass":"MindNode","ID":"54KXS","lineColorHex":"#1BD6E7","text":"n*m矩阵Allocation表示已经给各进程分配了多少资源"},"3":{"objectClass":"MindNode","ID":"01P8U","lineColorHex":"#1BD6E7","text":"Max-Allocation=Need矩阵表示各进程最多还需要多少资源"},"4":{"objectClass":"MindNode","ID":"4G515","lineColorHex":"#1BD6E7","text":"用长度为m的一位数组Request表示进程此次申请的各种资源数"},"objectClass":"NSArray"},"text":"数据结构"},"1":{"objectClass":"MindNode","ID":"MWOK2","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"4L04B","lineColorHex":"#1BD6E7","text":"检查此次申请是否超过了之前申明的最大需求数"},"1":{"objectClass":"MindNode","ID":"52IB8","lineColorHex":"#1BD6E7","text":"检查此时系统剩余的可用资源是否还能满足这次请求"},"2":{"objectClass":"MindNode","ID":"HTB4G","lineColorHex":"#1BD6E7","text":"试探着分配，更改各数据结构"},"3":{"objectClass":"MindNode","ID":"NW1O9","lineColorHex":"#1BD6E7","text":"用安全性算法检查此次分配是否会导致系统进入不安全状态"},"4":{"objectClass":"MindNode","ID":"1VM83","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"2ZF89","lineColorHex":"#1BD6E7","text":"安全性算法步骤:\n检查当前的剩余可用资源是否能满足某个进程的最大需求，如果可以，就把该进程加入安全序列，\n并把该进程持有的资源全部回收。\n不断重复上述过程，看最终是否能让所有进程都加入安全序列。\n系统处于不安全状态未必死锁，但死锁时一定处于不安全状态。系统处于安全状态一定不会死锁。"},"objectClass":"NSArray"},"text":"安全性算法步骤"},"objectClass":"NSArray"},"text":"算法步骤"},"objectClass":"NSArray"},"text":"如何避免系统进入不安全状态--银行家算法"},"objectClass":"NSArray"},"text":"避免系统进入不安全状态"},"objectClass":"NSArray"},"text":"避免死锁"},"2":{"objectClass":"MindNode","ID":"UM6RV","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"K5D41","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"C9PJC","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"HTW5Q","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"4259L","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"Y64EK","lineColorHex":"#1BD6E7","text":"进程结点"},"1":{"objectClass":"MindNode","ID":"7NMO8","lineColorHex":"#1BD6E7","text":"资源结点"},"objectClass":"NSArray"},"text":"两种结点"},"1":{"objectClass":"MindNode","ID":"YRCY0","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"944O5","lineColorHex":"#1BD6E7","text":"进程结点--->资源结点（请求边）"},"1":{"objectClass":"MindNode","ID":"80173","lineColorHex":"#1BD6E7","text":"资源结点--->进程结点（分配边）"},"objectClass":"NSArray"},"text":"两种边"},"objectClass":"NSArray"},"text":"数据结构：资源分配图"},"1":{"objectClass":"MindNode","ID":"JBR3T","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"L8B27","lineColorHex":"#1BD6E7","text":"依次消除与不阻塞进程相连的边，知道无边可消"},"1":{"objectClass":"MindNode","ID":"F772F","lineColorHex":"#1BD6E7","text":"注：所谓不阻塞进程是之其申请的资源数还足够的进程"},"2":{"objectClass":"MindNode","ID":"L3FW4","lineColorHex":"#1BD6E7","text":"死锁定理：若资源分配图是不可完全简化的，说明发生了死锁"},"objectClass":"NSArray"},"text":"死锁检测算法"},"objectClass":"NSArray"},"text":"死锁的检测"},"1":{"objectClass":"MindNode","ID":"22829","lineColorHex":"#1BD6E7","children":{"0":{"objectClass":"MindNode","ID":"N6E78","lineColorHex":"#1BD6E7","text":"资源剥夺法"},"1":{"objectClass":"MindNode","ID":"38898","lineColorHex":"#1BD6E7","text":"撤销进程法（终止进程法）"},"2":{"objectClass":"MindNode","ID":"68LS7","lineColorHex":"#1BD6E7","text":"进程回退法"},"objectClass":"NSArray"},"text":"死锁的解除"},"objectClass":"NSArray"},"text":"允许死锁发生，系统负责检测出死锁并解除"},"objectClass":"NSArray"},"text":"死锁的检测和解除"},"objectClass":"NSArray"},"text":"死锁的处理"},"objectClass":"NSArray"},"text":"死锁"},"objectClass":"NSArray"},"text":"操作系统"}}